<?php
 include("data.php");
 $path = "../db/daten.csv";
 if(isset($_GET['group']) && isset($_GET['action'])) {
	$group = $_GET['group'];
	$group_data = get_group_data_as_csv($path,$group);
	switch($_GET['action']) {
		case "update-data":
			if(isset($_GET['name']) 
				&& isset($_GET['long']) 
				&& isset($_GET['lat']) 
				&& isset($_GET['height']) 
				&& isset($_GET['time'])){
				$name = $_GET['name'];
				$lat = $_GET['lat'];
				$long = $_GET['long'];
				$height = $_GET['height'];
				$time = $_GET['time'];
				$is_start = $_GET['isStart'];
				refresh_coordinates($path, $name, $long, $lat, $time, $height, $group, $is_start);
				echo $group_data;
			}
			
		break;
	}
 }
?>